package com.state.example;

public class EveningState extends State {
    @Override
    public void writeProgram(Work w) {
        if(w.taskFinished){
            w.setState(new RestState());
            w.writeProgram();
        }else {
            if (w.hour<21){
                System.out.println("当前时间:"+w.hour);
            }else {
                w.setState(new SleepingState());
                w.writeProgram();
            }
        }
    }
}
